home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BUG 6
/
BUGCD1997_09.BIN
/
APLIC
/
PAGEMAKR
/
ARCHIVE.Z
/
Nested Group.SPT
< prev
next >
Wrap
Text File
|
1996-10-31
|
2KB
|
65 lines
-- Nested Group
-- 1 Oct 96, vs
-- This script will allow you to create a "nested group"
-- which can contain other groups. When you then run
-- the "nested ungroup" script, the original groups will
-- be retained.
getselectidlisttop => N,selectidlisttop
set => newgrouplist
set => newTOC
loop n=1,N
set selectidlisttop => id,...,...,...,type,...,...,...,...,...,...,...,...,...,...,selectidlisttop
if not(type=14)
set newgrouplist,id=>newgrouplist
else
try getprivatestring "Vlad","NGrp",classobject,0,id => npd,TOC
if not(npd?0,1)
rem this group is not nested
getgrouplist id => M,grouplist
set => grouplist[id]
set newTOC,id=>newTOC
loop m=1,M
set grouplist=> id.g,...,...,...,type.g,...,...,...,...,...,...,...,...,...,...,grouplist
if type.g=14
message "Bad structure of a nonnested group id #" + str(id)
return
endif
set grouplist[id],id.g=>grouplist[id]
endloop
else
rem this group is nested
set ~""(TOC)=>TOC
set newTOC,TOC=>newTOC
while not(empty(TOC))
set TOC=>id.g,TOC
try getprivatestring "Vlad","NGrp",classobject,id.g,id => npd,grouplist[id.g]
if not(npd?0,1)
message "Bad structure of a nonnested group id #" + str(id)
return
endif
set ~""(grouplist[id.g])=>grouplist[id.g]
endwhile
endif
set -id,newgrouplist=>newgrouplist
endif
endloop
group
getselectidlisttop => ...,newId,...
set newgrouplist=>grouplist[newId]
if (listlens(""(grouplist[mewId]))>255)+(listlens(""(newId,newTOC))>255)
message "Group too big. Script terminated."
return
endif
privatestring "Vlad","NGrp",classobject,newId,1,newId,1,""(grouplist[newId])
privatestring "Vlad","NGrp",classobject,0,1,newId,1,""(newId,newTOC)
while not(empty(newTOC))
set newTOC=>id.g,newTOC
privatestring "Vlad","NGrp",classobject,id.g,1,newId,1,""(grouplist[id.g])
endwhile
return